<?php $url = exec('cat scripts/getwan/.temp_wan');
 	   $average_temp1 = exec('tail -n 1 scripts/terra_control/log/Terra1');
	   $out_temp = exec('cat /sys/class/hwmon/hwmon1/device/temp1_input');
	   $restart= $_POST["case"];

	   if ($restart == "Start" )
	   {
	   		exec('./scripts/main.sh stream-start');
			echo $restart;
       }elseif ($restart == "Stop") {
	   		exec('./scripts/main.sh stream-stop');
			echo $restart;
	   }

		
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title> Terrarien Steuerung </title>
  <meta name="description" content="">
  <meta name="keywords" content="">
  <link rel="stylesheet" href="style.css" type="text/css">
</head>

<body>





<h2><?php echo "Temperatur Durchschnitt (Innen): $average_temp1 &deg;C"; ?></h2>
<h2><?php echo "Au&szlig;entemperatur: $out_temp[0]$out_temp[1].$out_temp[2] &deg;C"; ?></h2>
<p></p>




   
<div class="view box" style="height: 440px"><img id="webcam" src="http://<?php echo $url; ?>:8080/?action=stream" width="640" height="480">
</div>
	
<form action="main.php" method="post">
<table border=3>
  <tr>
  	<td>
		<input type="submit" name="case" value="Start">
	</td>
	<td>	
		<input type="submit" name="case" value="Stop">
  	</td>
  </tr>
</form>		

<!--<li><li>Erste Seite zum Terrarium Webinterface </li></li>!-->
<!--<li><h3>Willkommen (Seite im Aufbau)</h3></li>!-->
<!--<li></li>!-->
<!--<li></li>!-->
<!--<li></li>!-->
<!--<li></li>!-->
<!--<li></li>!-->
<!--<li></li></i></p>!-->
<!--<div class="frame"><a style="font-weight:normal" href="index.html" target="_top">Frame fehlt? Bitte nachladen.</a></div>!-->
</body>
</html>
